<?php
namespace Phone\Model;
use Think\Model;
use Think\Model\RelationModel;
class TakeModel extends RelationModel{
	protected $_validate = array(
		array('phone','require','请输入收件人联系电话'),
        //array('addr','require','请选择地址'),
        array('name','require','请输入收件人姓名'),
		array('no','require','请输入快递单号'),
        array('container_id','require','请选择货柜编号'),
		array('phone','/^(1\d{10})|((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/','联系电话格式有误'),
   	);
	protected $_link = array(
        'container' => array(
            'mapping_type'  => self::BELONGS_TO,
            'class_name'    => 'Container',
            'foreign_key'   => 'container_id',
            'mapping_fields' => 'no'
        )
    );

}
?>